<?php require_once('../Connections/miportal.php');
mysql_query("SET NAMES 'utf8'");
 ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  @session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
  $_SESSION['MM_id_target']=NULL;
	$_SESSION['MM_aut_target']=NULL;
	$_SESSION['MM_nmb_target']=NULL;
	$_SESSION['MM_tp_programa']=NULL;
	$_SESSION['MM_id_candidato']=NULL;
	$_SESSION['MM_id_empresa']=NULL;
	
  $logoutGoTo = "../private/login.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
 @session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "../private/login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_rs_rov = "-1";
if (isset($_SESSION['MM_id_target'])) {
  $colname_rs_rov = $_SESSION['MM_id_target'];
}
mysql_select_db($database_miportal, $miportal);
$query_rs_rov = sprintf("SELECT id_usuario, tp_perfil, tp_programa, id_cat_convocatoria, id_target, nmb_target, nmb_titulo, nmb_nombres, nmb_apaterno, nmb_amaterno, inf_correo_p, acs_password, acs_usuario FROM cat2_usuario WHERE tp_programa<>\"VIGENTES\" AND tp_perfil=\"ROV\" AND id_target = %s", GetSQLValueString($colname_rs_rov, "int"));
@$rs_rov = mysql_query($query_rs_rov, $miportal) or die(mysql_error());
$row_rs_rov = mysql_fetch_assoc($rs_rov);
$totalRows_rs_rov = mysql_num_rows($rs_rov);
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximun-scale=1">
<title>FUNDACIÓN EDUCACIÓN SUPERIOR-EMPRESA</title>
<!--Hoja de estilo principal-->
<link href="../css/styletd2.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="stylesheet/img/devil-icon.png"> 
<link rel="stylesheet" type="text/css" href="../css/mos-style.css">
<link rel="stylesheet" type="text/css" href="../css/menu.css"><!--Pemanggilan gambar favicon-->
 <!--pemanggilan file css-->
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
 <header>
    <div id="background"></div><!--BackGround Menu header-->
		<div class="img_header_logo"></div>
		<span class="img_header_logo"><a href="http://fese.org.mx"><img src="../images/fese/FESE_home_logo.png"  height="90" alt="FESE" align="bottom" /></a></span>
		<div class="img_header_logo"></div>
		<div id="nav">
		<ul>
		  <li class="nivel1"><a href="../private/riv.php" class="nivel1">Inicio</a></li>
		 <!-- <li class="nivel1"><a href="../report/report_riv_emp.php" class="nivel1">Empléate</a></li>
		  <li class="nivel1"><a href="../report/report_riv_exp.php" class="nivel1">Experimenta</a></li>
		  <li class="nivel1"><a href="../report/report_riv_mpe.php" class="nivel1">MPE</a></li>  -->
		 <!-- <li class="nivel1"><a href="../report_riv_bv.php" class="nivel1">BV</a></li>  -->
		  <li class="nivel1"><a href="../report/report_riv_rov.php" class="nivel1">Cuentas</a></li>
		</ul>
		</div><!--Menu NAV-->
</header>
<center>
<div id="boxcontainer">
<div id="container">
  <p>&nbsp;</p>
  <h2>Responsables Operativos de Vinculación (ROV)</h2>
  <?php 
  		if ($totalRows_rs_rov<4){ echo "<p><a href=\"../form/form_add_rov.php\">Agregar ROV</a></p>";}
		else {echo "Ha alcanzado el número máximo de responsables operativos."; }
  
  ?>
  
  <p>&nbsp;</p>
  <table width="720" border="1" cellspacing="0" cellpadding="0">
    <tr>
      <th class="data" scope="col">PROGRAMA</th>
      <th class="data" scope="col">NOMBRE COMPLETO</th>
      <th class="data" scope="col">CORREO ELECTRÓNICO</th>
      <th class="data" scope="col">USUARIO</th>
      <th class="data" scope="col">CONTRASEÑA</th>
      </tr>
    <?php do { ?>
      <tr>
        <td class="data"><?php echo $row_rs_rov['tp_programa']; ?></td>
        <td class="data"><?php echo $row_rs_rov['nmb_titulo']; ?> <?php echo $row_rs_rov['nmb_nombres']; ?> <?php echo $row_rs_rov['nmb_apaterno']; ?> <?php echo $row_rs_rov['nmb_amaterno']; ?></td>
        <td class="data"><?php echo $row_rs_rov['inf_correo_p']; ?></td>
        <td class="data"><?php echo $row_rs_rov['acs_usuario']; ?></td>
        <td class="data"><?php echo $row_rs_rov['acs_password']; ?></td>
      </tr>
      <?php } while ($row_rs_rov = mysql_fetch_assoc($rs_rov)); ?>
  </table>
  <p>&nbsp;</p>
  <p>Nota: Sólo se puede agregar un Responsable operativo de vinculación por programa. <br> La FESE no realiza notificación a través de correo electrónico a los Responsables Operativos de Vinculación (ROV), por lo que, deberás compartir los datos de usuario y contraseña a cada uno de ellos.</p>
<p>.</p>
  <p>&nbsp;</p>
  <div id="dinamicContaint">
  
  </div><!--dinamicContaint-->
  <p>&nbsp;</p>
</div><!--Container-->
<?php include_once('../include/riv_rigth_container.php');?>
</div><!--Boxcontainer-->
</center>
  
  
</body>
</html>
<?php
mysql_free_result($rs_rov);
?>
